package com.feng.zhihao.apigeteway.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * InterfaceInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "INTERFACE_INFO", uniqueConstraints = @UniqueConstraint(columnNames = {
		"INTERFACE_NAME", "PROJECT_ID" }))

public class InterfaceInfo implements java.io.Serializable {

	// Fields

	private String interfaceId;
	private ModularInfo modularInfo;
	private ProjectInfo projectInfo;
	private String interfaceName;
	private String interfaceVersion;
	private Integer interfaceState;
	private String interfaceExplain;
	private Set<InterfaceCaseInfo> interfaceCaseInfos = new HashSet<InterfaceCaseInfo>(0);
	private Set<ChannelInterface> channelInterfaces = new HashSet<ChannelInterface>(0);
	private Set<InterfaceFieldInfo> interfaceFieldInfos = new HashSet<InterfaceFieldInfo>(0);
	private Set<ChannelInterfaceCase> channelInterfaceCases = new HashSet<ChannelInterfaceCase>(0);

	// Constructors

	/** default constructor */
	public InterfaceInfo() {
	}

	/** minimal constructor */
	public InterfaceInfo(String interfaceId) {
		this.interfaceId = interfaceId;
	}

	/** full constructor */
	public InterfaceInfo(String interfaceId, ModularInfo modularInfo, ProjectInfo projectInfo, String interfaceName,
			String interfaceVersion, Integer interfaceState, String interfaceExplain,
			Set<InterfaceCaseInfo> interfaceCaseInfos, Set<ChannelInterface> channelInterfaces,
			Set<InterfaceFieldInfo> interfaceFieldInfos, Set<ChannelInterfaceCase> channelInterfaceCases) {
		this.interfaceId = interfaceId;
		this.modularInfo = modularInfo;
		this.projectInfo = projectInfo;
		this.interfaceName = interfaceName;
		this.interfaceVersion = interfaceVersion;
		this.interfaceState = interfaceState;
		this.interfaceExplain = interfaceExplain;
		this.interfaceCaseInfos = interfaceCaseInfos;
		this.channelInterfaces = channelInterfaces;
		this.interfaceFieldInfos = interfaceFieldInfos;
		this.channelInterfaceCases = channelInterfaceCases;
	}

	// Property accessors
	@Id

	@Column(name = "INTERFACE_ID", unique = true, nullable = false, length = 36)

	public String getInterfaceId() {
		return this.interfaceId;
	}

	public void setInterfaceId(String interfaceId) {
		this.interfaceId = interfaceId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MODULAR_ID")

	public ModularInfo getModularInfo() {
		return this.modularInfo;
	}

	public void setModularInfo(ModularInfo modularInfo) {
		this.modularInfo = modularInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID")

	public ProjectInfo getProjectInfo() {
		return this.projectInfo;
	}

	public void setProjectInfo(ProjectInfo projectInfo) {
		this.projectInfo = projectInfo;
	}

	@Column(name = "INTERFACE_NAME", length = 512)

	public String getInterfaceName() {
		return this.interfaceName;
	}

	public void setInterfaceName(String interfaceName) {
		this.interfaceName = interfaceName;
	}

	@Column(name = "INTERFACE_VERSION", length = 512)

	public String getInterfaceVersion() {
		return this.interfaceVersion;
	}

	public void setInterfaceVersion(String interfaceVersion) {
		this.interfaceVersion = interfaceVersion;
	}

	@Column(name = "INTERFACE_STATE")

	public Integer getInterfaceState() {
		return this.interfaceState;
	}

	public void setInterfaceState(Integer interfaceState) {
		this.interfaceState = interfaceState;
	}

	@Column(name = "INTERFACE_EXPLAIN", length = 4096)

	public String getInterfaceExplain() {
		return this.interfaceExplain;
	}

	public void setInterfaceExplain(String interfaceExplain) {
		this.interfaceExplain = interfaceExplain;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "interfaceInfo")

	public Set<InterfaceCaseInfo> getInterfaceCaseInfos() {
		return this.interfaceCaseInfos;
	}

	public void setInterfaceCaseInfos(Set<InterfaceCaseInfo> interfaceCaseInfos) {
		this.interfaceCaseInfos = interfaceCaseInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "interfaceInfo")

	public Set<ChannelInterface> getChannelInterfaces() {
		return this.channelInterfaces;
	}

	public void setChannelInterfaces(Set<ChannelInterface> channelInterfaces) {
		this.channelInterfaces = channelInterfaces;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "interfaceInfo")

	public Set<InterfaceFieldInfo> getInterfaceFieldInfos() {
		return this.interfaceFieldInfos;
	}

	public void setInterfaceFieldInfos(Set<InterfaceFieldInfo> interfaceFieldInfos) {
		this.interfaceFieldInfos = interfaceFieldInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "interfaceInfo")

	public Set<ChannelInterfaceCase> getChannelInterfaceCases() {
		return this.channelInterfaceCases;
	}

	public void setChannelInterfaceCases(Set<ChannelInterfaceCase> channelInterfaceCases) {
		this.channelInterfaceCases = channelInterfaceCases;
	}

}